<template>
  <div id="vue-admin-beautiful">
    <router-view />
  </div>
</template>

<script>
  import store from '@/store'
  export default {
    name: 'App',
    mounted() {
      let token = sessionStorage.getItem('token')
      this.$store.dispatch('user/setToken',token)
      //console.log(this.$store.getters)
    },
    watch:{
      '$route':{
        handler: function(newVal, oldVal){
          if(newVal.meta.auth){
            const userInfo = store.getters['baseStore/userInfo']
            this.$store.dispatch('baseStore/getSchoolData',userInfo)
          }
        },
        deep: true
      }
    }
  }
</script>
<style>
   .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 148px;
    height: 148px;
    line-height: 148px !important;
    text-align: center;
  }
  .avatar {
    width: 148px;
    height: 148px;
    display: block;
  }
</style>
